<template>
  <div>
    <div>
      <span>{{list.username}}</span>
      <span>邮箱</span>
    </div>
    <div>修改登陆密码</div>
    <div>修改个人信息</div>
    <div>收货地址管理</div>
    <span @click="layout">退出登录</span>
  </div>
</template>

<script>
export default {
    created() {
        this.getItem()
    },
    data(){
        return{
            list:[]
        }
    },
  methods: {
    async getItem() {
      const res = await this.$require({
        url: "/user/info",
        method: "get",
      });
      if (res.status == 200) {
        this.list = res.data.data;
        console.log(this.list);
      }
    },
     async layout(){
        const res= await this.$require({
            url:'/user/logout',
            method:'post'
        }).catch(error=>{
            console.log(error);
        })
        console.log(res);
        if(res.status==200){
            this.$router.push('/home')
        }
    }
  },
};
</script>

<style lang="scss" scoped>
</style>